package com.lwf.thymeleafdemo1.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobalExceptionResolver {

    @ExceptionHandler(RuntimeException.class)
    @ResponseBody
    public String handlerRuntimeException(Exception e) {
        return e.getMessage();
    }

}
